package com.cw.jeeyt.dao.impl.api;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.cw.jeeyt.common.Order;
import com.cw.jeeyt.dao.intf.api.ApiFacadeObjParamDao;
import com.cw.jeeyt.dao.mapper.api.ApiFacadeObjParamMapper;
import com.cw.jeeyt.dao.model.api.ApiFacadeObjParamDo;
import com.cw.lang.common.utils.PageUtil;
import com.cw.lang.common.pagehelper.PageHelper;
import com.cw.lang.mybatis.dto.PageInfo;

/**
 * 接口方法参数对象具体参数 dao数据库操作接口
 *
 * @author chenw
 * @version 1.0.0
 */
@Repository
public class ApiFacadeObjParamDaoImpl implements ApiFacadeObjParamDao {
    @Autowired
    private ApiFacadeObjParamMapper apiFacadeObjParamMapper;

    /**
     * 新增接口方法参数对象具体参数
     *
     * @param apiFacadeObjParam
     * @return 整数
     */
    public Integer insert(ApiFacadeObjParamDo apiFacadeObjParam) {
        return apiFacadeObjParamMapper.insert(apiFacadeObjParam);
    }

    /**
     * 新增接口方法参数对象具体参数不为空的字段
     *
     * @param apiFacadeObjParam
     * @return 整数
     */
    public Integer insertSelective(ApiFacadeObjParamDo apiFacadeObjParam) {
        return apiFacadeObjParamMapper.insertSelective(apiFacadeObjParam);
    }

    /**
     * 删除接口方法参数对象具体参数
     *
     * @param apiFacadeObjParam
     */
    public void delete(ApiFacadeObjParamDo apiFacadeObjParam) {
        apiFacadeObjParamMapper.delete(apiFacadeObjParam);
    }

    /**
     * 修改接口方法参数对象具体参数不为null的字段
     *
     * @param apiFacadeObjParam
     */
    public void updateSelective(ApiFacadeObjParamDo apiFacadeObjParam) {
        apiFacadeObjParamMapper.updateSelective(apiFacadeObjParam);
    }

    /**
     * 修改接口方法参数对象具体参数
     *
     * @param apiFacadeObjParam
     */
    public void update(ApiFacadeObjParamDo apiFacadeObjParam) {
        apiFacadeObjParamMapper.update(apiFacadeObjParam);
    }

    /**
     * 根据主键查询接口方法参数对象具体参数
     *
     * @return 接口方法参数对象具体参数
     */
    public ApiFacadeObjParamDo getById(Long id) {
        return apiFacadeObjParamMapper.getById(id);
    }

    /**
     * 查询所有接口方法参数对象具体参数
     *
     * @return 接口方法参数对象具体参数集合
     */
    public List<ApiFacadeObjParamDo> queryApiFacadeObjParamList() {
        return apiFacadeObjParamMapper.queryApiFacadeObjParamList();
    }

    /**
     * 分页查询接口方法参数对象具体参数
     *
     * @param apiFacadeObjParam 查询条件
     * @param startRow 开始条数
     * @param pageSize 每页长度
     * @return 接口方法参数对象具体参数集合
     */
    public PageInfo<ApiFacadeObjParamDo> queryByPage(ApiFacadeObjParamDo apiFacadeObjParam, Integer startRow,
        Integer pageSize, Order order) {
        PageHelper.startPage(PageUtil.calPageNum(startRow, pageSize), pageSize);
        return new PageInfo<>(apiFacadeObjParamMapper.queryByPage(apiFacadeObjParam, order));
    }

    /**
     * 批量新增接口方法参数对象具体参数
     *
     * @param objParamList
     * @return
     */
    public Integer insertBat(List<ApiFacadeObjParamDo> objParamList) {
        return apiFacadeObjParamMapper.insertBat(objParamList);
    }

    /**
     * 根据对象id查询对象参数集合信息
     *
     * @param objId
     * @return
     */
    public List<ApiFacadeObjParamDo> queryListByObjId(Long objId) {
        return apiFacadeObjParamMapper.queryListByObjId(objId);
    }
}
